package com.facemox.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.facemox.bean.PermissionAuthentication;
import com.facemox.mapper.AuthorizationMapper;
import com.facemox.service.AuthorizationService;

@Service
public class AuthorizationServiceImpl implements AuthorizationService {

    @Autowired
    private AuthorizationMapper authorizationMapper;
    
    @Override
    public int addAuthorization(PermissionAuthentication permissionAuthentication) {
        int addAuthentication = authorizationMapper.addAuthentication(permissionAuthentication);
        return addAuthentication;
    }

    @Override
    public List<PermissionAuthentication> findAuthorization() {
        List<PermissionAuthentication> authorizationList = authorizationMapper.findAuthorizationByAll();
        return authorizationList;
    }

    @Override
    public int deleteAuthorizationById(Integer authenticationId) {
        int effectLine = authorizationMapper.deleteAuthorizationById(authenticationId);
        return effectLine;
    }

    @Override
    public PermissionAuthentication findAuthorizationByAuthenticationId(Integer authenticationId) {
        PermissionAuthentication auth = authorizationMapper.findAuthorizationByAuthenticationId(authenticationId);
        return auth;
    }

}
